<form method="post" action="<?php echo LinkGen::getInstance(LinkGen::PRODUCT)->link($product['id'], array('action' => 'submitComment'))  ?>">
<div id="comment_flashes">
	<?php $sf_user->getFlash('comment_flash') ?>
</div>
	
<?php echo $commentsForm->renderHiddenFields(true) ?>
	<div class="forms">
		<?php echo $commentsForm['name']->render(array('class' => 'sideinput' ) )  ?>
	</div>
	<div class="forms" style="padding-top:5px;">
		<?php echo $commentsForm['email']->render(array('class' => 'sideinput' ) )  ?>
	</div>
	<div class="formsarea">
		<?php echo $commentsForm['message']->render(array('class' => 'areatext'))  ?>
	</div>
	<div class="code">
		<img id="captcha_img" src="/captcha?t=<?php echo time() ?>" width="94" height="23" alt=""/>
	</div>
	<div class="codeinput">
		<?php echo $commentsForm['captcha']->render(array('class' => 'codein'   ) )  ?>
	</div>
	<div class="sabutton">
		<div class="sabuttonleft"><img src="/project_css_js/img/sbuttonleft.png" width="8" height="20" alt=""/></div>
		<div class="sabuttoncenter"><p><a id="comments_form_submit" href="#"><?php echo __('saada') ?></a></div>
		<div class="sabuttonright"><img src="/project_css_js/img/sbuttonright.png" width="8" height="20" alt=""/></div>
	</div>
	<div class="clear"></div>
</form>
<script type="text/javascript">
	$('#comments_form_submit').click(function(e){
		e.preventDefault();
		var form = $(this).parents('form');

		$.post(form.attr('action'), form.serialize(), function(data){
			if(data.status==500){
				var cap = $('#captcha_img');
				cap.attr('src', cap.attr('src') + '1');
				alert('<?php echo __('wrong code or email') ?>');
			}else{
				window.location = data.redirectLink;
			}
		},'json');
		
		return false;
	});
</script>